//
//  NewStudentSearchHeard.m
//  test
//
//  Created by 李彦宏 on 2018/3/16.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "NewStudentSearchHeard.h"

@implementation NewStudentSearchHeard


//自定义view初始化方法
- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        /* 添加子控件的代码*/
        [self setUI];
    }
    return self;
    
}
//添加子控件
-(void)setUI{
    #pragma -mark ————————————搜索UI————————————————————
    UIView *blckV=[[UIView alloc]initWithFrame:CGRectMake(0, 0, Screen_width, 30)];
    blckV.backgroundColor=[UIColor blackColor];
    [self addSubview:blckV];
    /**
     *数学：数一、数二、数三、396、199、无
     *英语：英一、英二、日语、其他
     */
    EBDropdownListItem *item1 = [[EBDropdownListItem alloc] initWithItem:@"1" itemName:@"数学"];
    EBDropdownListItem *item2 = [[EBDropdownListItem alloc] initWithItem:@"2" itemName:@"数一"];
    EBDropdownListItem *item3 = [[EBDropdownListItem alloc] initWithItem:@"3" itemName:@"数二"];
    EBDropdownListItem *item4 = [[EBDropdownListItem alloc] initWithItem:@"4" itemName:@"数三"];
    EBDropdownListItem *item5 = [[EBDropdownListItem alloc] initWithItem:@"5" itemName:@"396"];
    EBDropdownListItem *item6 = [[EBDropdownListItem alloc] initWithItem:@"6" itemName:@"199"];
    EBDropdownListItem *item7 = [[EBDropdownListItem alloc] initWithItem:@"7" itemName:@"无"];
    //英语
    EBDropdownListItem *Eitem1 = [[EBDropdownListItem alloc] initWithItem:@"1" itemName:@"英语"];
    EBDropdownListItem *Eitem2 = [[EBDropdownListItem alloc] initWithItem:@"2" itemName:@"英一"];
    EBDropdownListItem *Eitem3 = [[EBDropdownListItem alloc] initWithItem:@"3" itemName:@"英二"];
    EBDropdownListItem *Eitem4 = [[EBDropdownListItem alloc] initWithItem:@"4" itemName:@"日语"];
    EBDropdownListItem *Eitem5 = [[EBDropdownListItem alloc] initWithItem:@"5" itemName:@"其他"];
    // 数学弹出框向下
    _MathdropdownListView = [EBDropdownListView new];
    _MathdropdownListView.dataSource = @[item1, item2, item3, item4,item5,item6,item7];
    _MathdropdownListView.frame = CGRectMake(3,1.5, ScreenWidth/4-6, 27);
    _MathdropdownListView.selectedIndex = 0;
//    _MathdropdownListView.textColor=[UIColor whiteColor];
    _MathdropdownListView.backgroundColor=[UIColor whiteColor];
    [_MathdropdownListView setViewBorder:0.5 borderColor:[UIColor grayColor] cornerRadius:2];
    [blckV addSubview:_MathdropdownListView];
    
    // 英语弹出框向下
    _EnglishdropdownListView = [EBDropdownListView new];
    _EnglishdropdownListView.dataSource = @[Eitem1, Eitem2, Eitem3, Eitem4,Eitem5];
    _EnglishdropdownListView.frame = CGRectMake(ScreenWidth/4+3, 1.5, ScreenWidth/4-6, 27);
    _EnglishdropdownListView.backgroundColor=[UIColor whiteColor];
    _EnglishdropdownListView.selectedIndex = 0;
    [_EnglishdropdownListView setViewBorder:0.5 borderColor:[UIColor grayColor] cornerRadius:2];
    [blckV addSubview:_EnglishdropdownListView];
    
    
    UIButton *lbtn = [[UIButton alloc]init];
    [lbtn setFrame:CGRectMake(Screen_width/2, 3, Screen_width/2-10, 24)];
    lbtn.backgroundColor=[UIColor whiteColor];
    lbtn.layer.cornerRadius=5;
    [lbtn setTitle:@"学员姓名" forState:UIControlStateNormal];
    UIImage *image=[UIImage imageNamed:@"searchbar_textfield_search_icon"];
    [lbtn setImage:image forState:UIControlStateNormal];
    [lbtn setTitleEdgeInsets:UIEdgeInsetsMake(0,-60, 0,image.size.width)];
    [lbtn setImageEdgeInsets:UIEdgeInsetsMake(0, 120, 0, -lbtn.titleLabel.bounds.size.width)];
    self.SearchBtn=lbtn;
    [lbtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    
    [blckV addSubview:lbtn];
   #pragma -mark ———————————学员头UI————————————————————
    UILabel *lb2=[[UILabel alloc] init];
    [lb2 setBackgroundColor:[UIColor clearColor]];
    [lb2 setTextColor:[UIColor blackColor]];
    [lb2 setFont:[UIFont systemFontOfSize:15]];
    lb2.textAlignment=NSTextAlignmentCenter;
    lb2.text=@"姓名";
    [self addSubview:lb2];
    lb2.frame = CGRectMake(15, 37, 40, 30);
    
    UILabel *lb3=[[UILabel alloc] init];
    [lb3 setBackgroundColor:[UIColor clearColor]];
    [lb3 setTextColor:[UIColor blackColor]];
    [lb3 setFont:[UIFont systemFontOfSize:15]];
    lb3.textAlignment=NSTextAlignmentCenter;
    lb3.text=@"电话";
    [self addSubview:lb3];
    lb3.frame = CGRectMake(70, 37, (ScreenWidth-120)/2, 30);
    
    UILabel *lb4=[[UILabel alloc] init];
    [lb4 setBackgroundColor:[UIColor clearColor]];
    [lb4 setTextColor:[UIColor blackColor]];
    [lb4 setFont:[UIFont systemFontOfSize:15]];
    lb4.textAlignment=NSTextAlignmentCenter;
    lb4.text=@"研究生";
    [self addSubview:lb4];
    lb4.frame = CGRectMake(60+(ScreenWidth-120)/2, 37, (ScreenWidth-120)/2, 30);
    
    UILabel *lb5=[[UILabel alloc] init];
    [lb5 setBackgroundColor:[UIColor clearColor]];
    [lb5 setTextColor:[UIColor blackColor]];
    [lb5 setFont:[UIFont systemFontOfSize:15]];
    lb5.textAlignment=NSTextAlignmentCenter;
    lb5.text=@"协议";
    [self addSubview:lb5];
    lb5.frame = CGRectMake(ScreenWidth-60, 37, 45, 30);
//下划线
    UILabel *Xlb=[[UILabel alloc]init];
    Xlb.backgroundColor=[UIColor lightGrayColor];
    Xlb.text=@" ";
    [self addSubview:Xlb];
    Xlb.frame=CGRectMake(0, 69.5, ScreenWidth, 0.5);

}

@end
